<template>
  <div v-cloak>
    <div class="list">
      <a href="#" @click="back()"><</a>
      <a @click="back()">返回列表</a>
    </div>
    <h3>{{datas.title}}</h3>
    <h6 class="author"><span>{{datas.created_at
}}</span><span>作者：{{datas.author}}</span></h6>
    <h5 class="readingNum"><img src="../assets/img/cooperate/zixun_01.png" alt=""><span>{{datas.look_num}}</span><img src="../assets/img/cooperate/zixun_03.png" alt="" class="priseNum"><span class="priseCount">{{datas.like_num}}</span></h5>
    <hr/>
    <div class="detailContent" v-html="datas.content">

    </div>
  </div>
</template>

<script>
    import {mapGetters} from 'vuex';
    export default {
        name: "detail",
        computed:mapGetters(['datas']),
        methods:{
          back(){
            window.history.go(-1);
          }
        },
        //刷新页码的时候自动发送action
        mounted(){
          var id=this.$route.params.detailId;
          this.$store.dispatch('getDetailData',id);
        }

    }
</script>

<style scoped>
  @import '../assets/css/detail.css';
  [v-cloak] {
    display: none;
  }
</style>
